package com.itrip.biz.controller;

import com.itrip.beans.dto.Dto;
import com.itrip.beans.vo.AreaDicVo;
import com.itrip.biz.service.HotelService;
import com.itrip.utils.DtoUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/hotel")
@Api
public class HotelController {

    @Autowired
    private HotelService hotelService;

    @GetMapping("/queryhotcity/{isChina}")
    @ApiOperation(value="根据类别查询热门城市",httpMethod = "GET",response = Dto.class,
        notes = "进一步说明")
    public Dto queryhotcity(
            @ApiParam(required = true,value = "1:国内，2:国外",name = "isChina")
            @PathVariable Integer isChina){
        return DtoUtil.returnDataSuccess(hotelService.queryhotcity(isChina));
    }

    @GetMapping("/queryhotelfeature")
    public Dto queryhotelfeature(){
        return DtoUtil.returnDataSuccess(hotelService.queryhotelfeature());
    }

    @GetMapping("/querytradearea/{id}")
    public Dto querytradearea(@PathVariable Integer id){
        List<AreaDicVo> list = hotelService.querytradearea(id);
        return DtoUtil.returnDataSuccess(list);
    }

    @GetMapping("/getvideodesc/{id}")
    public Dto getvideodesc(@PathVariable Integer id){
        return null;
    }
}
